package util;

public class KDDData {
	public int duration; 
	public String protocol_type; 
	public String service; 
	public String flag; 
	public int src_bytes; 
	public int dst_bytes; 
	public int land; 
	public int wrong_fragment; 
	public int urgent; 
	public int hot; 
	public int num_failed_logins; 
	public int logged_in; 
	public int num_compromised; 
	public int root_shell; 
	public int su_attempted; 
	public int num_root; 
	public int num_file_creations; 
	public int num_shells; 
	public int num_access_files; 
	public int num_outbound_cmds; 
	public int is_host_login; 
	public int is_guest_login; 
	public int count; 
	public int srv_count; 
	public float serror_rate; 
	public float srv_serror_rate; 
	public float rerror_rate; 
	public float srv_rerror_rate; 
	public float same_srv_rate; 
	public float diff_srv_rate; 
	public float srv_diff_host_rate; 
	public int dst_host_count; 
	public int dst_host_srv_count; 
	public float dst_host_same_srv_rate; 
	public float dst_host_diff_srv_rate; 
	public float dst_host_same_src_port_rate; 
	public float dst_host_srv_diff_host_rate; 
	public float dst_host_serror_rate; 
	public float dst_host_srv_serror_rate; 
	public float dst_host_rerror_rate; 
	public float dst_host_srv_rerror_rate; 
	public String label; 	
	String[] feature;
	public String raw;
	
	
	public KDDData( String data ){
		this.raw = data.substring(0, data.length()-1);
		this.feature = data.split(",");
		this.duration = Integer.valueOf(feature[0]); 
		this.protocol_type = feature[1]; 
		this.service = feature[2]; 
		this.flag = feature[3]; 
		this.src_bytes = Integer.valueOf(feature[4]); 
		this.dst_bytes = Integer.valueOf(feature[5]); 
		this.land = Integer.valueOf(feature[6]); 
		this.wrong_fragment = Integer.valueOf(feature[7]); 
		this.urgent = Integer.valueOf(feature[8]); 
		this.hot = Integer.valueOf(feature[9]); 
		this.num_failed_logins = Integer.valueOf(feature[10]); 
		this.logged_in = Integer.valueOf(feature[11]); 
		this.num_compromised = Integer.valueOf(feature[12]); 
		this.root_shell = Integer.valueOf(feature[13]); 
		this.su_attempted = Integer.valueOf(feature[14]); 
		this.num_root = Integer.valueOf(feature[15]); 
		this.num_file_creations = Integer.valueOf(feature[16]); 
		this.num_shells = Integer.valueOf(feature[17]); 
		this.num_access_files = Integer.valueOf(feature[18]); 
		this.num_outbound_cmds = Integer.valueOf(feature[19]); 
		this.is_host_login = Integer.valueOf(feature[20]); 
		this.is_guest_login = Integer.valueOf(feature[21]); 
		this.count = Integer.valueOf(feature[22]); 
		this.srv_count = Integer.valueOf(feature[23]); 
		this.serror_rate = Float.valueOf(feature[24]); 
		this.srv_serror_rate = Float.valueOf(feature[25]); 
		this.rerror_rate = Float.valueOf(feature[26]); 
		this.srv_rerror_rate = Float.valueOf(feature[27]); 
		this.same_srv_rate = Float.valueOf(feature[28]); 
		this.diff_srv_rate = Float.valueOf(feature[29]); 
		this.srv_diff_host_rate = Float.valueOf(feature[30]); 
		this.dst_host_count = Integer.valueOf(feature[31]); 
		this.dst_host_srv_count = Integer.valueOf(feature[32]); 
		this.dst_host_same_srv_rate = Float.valueOf(feature[33]); 
		this.dst_host_diff_srv_rate = Float.valueOf(feature[34]); 
		this.dst_host_same_src_port_rate = Float.valueOf(feature[35]); 
		this.dst_host_srv_diff_host_rate = Float.valueOf(feature[36]); 
		this.dst_host_serror_rate = Float.valueOf(feature[37]); 
		this.dst_host_srv_serror_rate = Float.valueOf(feature[38]); 
		this.dst_host_rerror_rate = Float.valueOf(feature[39]); 
		this.dst_host_srv_rerror_rate = Float.valueOf(feature[40]); 
		this.label = feature[41].substring(0, feature[41].length()-1); 
	}
}
